package cloud.example.eureka_consumer.controller;

import cloud.example.eureka_consumer.remote.HelloRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {
  @Autowired
  private HelloRemote helloRemote;

  @GetMapping("/hello/param/{name}")
  public String consumeHello(@PathVariable("name") String name) {
    return helloRemote.hello(name);
  }

  @GetMapping("/hello/dc")
  public String consumeDc() {
    return helloRemote.dc();
  }
}
